/**
 *
 * @author Mendes
 */
public class hash {
    //Do livro "The C Programming Language" de Brian Kernighan e Dennis Ritchie
    public long BKDRHash(char str[], int len){
        int seed = 131;
        long hash = 0;
        int i    = 0;
        for(i = 0; i < len; i++){
            hash = (hash * seed) + (str[i]);
        }
        return hash;
    }
    
    
}
